<?php
//Luu trang ngay tiep nhan hien thoi
$v_code = "";
if(isset($_REQUEST['hdn_code'])){
	$v_code = $_REQUEST['hdn_code'];
} 
$v_customer_name= "";
if(isset($_REQUEST['hdn_customer_name'])){
	$v_customer_name = $_REQUEST['hdn_customer_name'];
}
$v_customer_card_id = "";
if(isset($_REQUEST['hdn_customer_card_id'])){
	$v_customer_card_id = $_REQUEST['hdn_customer_card_id'];
}
if(_is_sqlserver()){//CSDL MSSQL 
	// Lay noi dung cua mot ho so
	$sql = "Exec Onegate_CustomerRecordGetSinglebyCode ";
	$sql = $sql. "'" . $v_code ."'";
	$sql = $sql. ",'" . $v_customer_name ."'";
	$sql = $sql. ",'" . $v_customer_card_id ."'";
	//echo $sql;exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_single_record = $ado_conn->GetRow($sql);
	$v_error = _replace_bad_char(trim($arr_single_record['RET_ERROR'])); 
}
sleep(0);
if (!is_null($v_error) && $v_error<>""){?>
	<script>
		alert("<?php echo $v_error; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<?php echo $v_goto_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?php
	exit;
}
?>